/***********************************************************************
 * Module:  AbstractDataBaseBuilder.java
 * Author:  wuxinyang
 * Purpose: Defines the Class AbstractDataBaseBuilder
 ***********************************************************************/

package com.witframework.plugin.lucene.builder.impl;

import java.io.InputStream;

import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;

import com.witframework.plugin.lucene.DocumentHandlerException;
import com.witframework.plugin.lucene.builder.DocumentBuilder;

/** 数据库资源Document创建器基类
 * 
 * @pdOid 14848b14-2223-47ef-9114-357fe35f02d2 */
public class ContentsDocumentBuilder implements DocumentBuilder {
	Document doc;
	/**
	 * 初始化Document对象。
	 * 设置“内容”索引域，将内容保存在索引中
	 */
	public ContentsDocumentBuilder(String contents){
		doc = new Document();
		doc.add(new Field("contents",contents, Field.Store.YES, Field.Index.TOKENIZED));
	}
	
	public Document createDocument(InputStream is)throws DocumentHandlerException {		
		return doc;
	}
}